﻿using System;

namespace Restful.Net
{
    /// <summary>
    /// Class used to hold information about the parameters to a service method.
    /// Mainly used for performance reasons, so expensive reflection calls can be done only once.
    /// </summary>
    public class ParamInfo
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ParamInfo"/> class.
        /// </summary>
        /// <param name="name">The name of the parameter.</param>
        /// <param name="paramType">Type of the param.</param>
        /// <param name="isBuiltIn">if set to <c>true</c> [is built in].</param>
        /// <param name="defaultValue">The default value.</param>
        public ParamInfo(string name, Type paramType, bool isBuiltIn, object defaultValue)
        {
            Name = name;
            ParamType = paramType;
            IsBuiltIn = isBuiltIn;
            DefaultValue = defaultValue;
        }

        /// <summary>
        /// Gets or sets the name of the parameter
        /// </summary>
        public string Name
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the data type of the paraeter.
        /// </summary>
        public Type ParamType
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets a value indicating whether this parameter is a built in .NET type of either a value type or string.
        /// </summary>
        public bool IsBuiltIn
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the default value of the parameter if there is any.
        /// </summary>
        public object DefaultValue
        {
            get;
            set;
        }
    }
}
